[backport][stable-2.16] Always allow "no-other-choice" pre-release dependencies when resolving collection dependency tree #81746
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of PR #81606.
Prior to this patch, when
--pre
CLI flag was not passed, the dependency resolver would treat concrete collection dependency candidates (Git repositories, subdirs, tarball URLs, or local dirs or files etc) as not meeting the requirements.This patch makes it so pre-releases in any concrete artifact references, and the ones being specifically pinned dependencies or user requests, met anywhere in the dependency tree, are allowed unconditionally.
This is achieved by moving the pre-release check from
is_satisfied_by()
to thefind_matches()
hook, following the Pip's example.As a bonus, this change also fixes the situation when a collection pre-releases weren't considered if it didn't have any stable releases. This now works even if
--pre
wasn't requested explicitly.Finally, this patch partially reverts commit
6f4b4c3, except for the tests. And it also improves the
--pre
hint warning to explain that it mostly affects Galaxy/Automation Hub-hosted collection releases.Ref #73416
Ref #79112
Fixes #79168
Fixes #80048
Resolves #81605
Co-authored-by: Sloane Hertel 19572925+s-hertel@users.noreply.github.com
(cherry picked from commit 7662a05)
SUMMARY
$sbj.
ISSUE TYPE
ADDITIONAL INFORMATION
Special thanks to @pradyunsg for hinting how to process pre-releases in the resolvelib provider correctly.